<?php

namespace app\common\service;

use app\common\service\Base;
use app\common\model\PointDetail as PointDetailModel;

class PointDetail extends Base
{

    public function __construct()
    {
        parent::__construct();
        $this->currentModel = new PointDetailModel();
    }

    /**
     * 获取金币流水列表
     * @param $customerId
     * @param $pageNum
     * @param $pageSize
     * @return array|\PDOStatement|string|\think\Collection
     */
    public function getAccountListForPage($customerId, $pageNum, $pageSize) {

        $map['customer_id'] = $customerId;

        return $this->currentModel
            ->field("point, type, create_time, refer_customer_nickname nickname, 
                    refer_customer_headimgurl headimgurl")
            ->where($map)
            ->order('id desc')
            ->page($pageNum, $pageSize)
            ->select();

    }

}